cmake_minimum_required(VERSION 3.8)
project(test_topic)

# Default to C++14
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  add_compile_options(-Wall -Wextra -Wpedantic)
endif()

# find dependencies
find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(std_msgs REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(Eigen3 REQUIRED)
find_package(test_utils REQUIRED)
find_package(geometry_msgs REQUIRED)

include_directories(
  include
)

add_executable(publisher 
  src/publisher.cpp
)
ament_target_dependencies(publisher rclcpp std_msgs test_utils)

add_executable(twist_pub 
  src/twist_pub.cpp
)
ament_target_dependencies(twist_pub rclcpp std_msgs geometry_msgs)

add_executable(subscriber 
  src/subscriber.cpp
)
ament_target_dependencies(subscriber rclcpp std_msgs)

install(
  TARGETS publisher subscriber twist_pub
  DESTINATION lib/${PROJECT_NAME}/
)

ament_package()
